package gui;

import java.awt.Color;
import java.awt.Rectangle;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JTextArea;

import client.Client;
import javax.swing.JRadioButton;

public class EmployeeCatalogOP extends JFrame{
	private JPanel mainform = null;
	private JLabel jLabelCatalogOptions = null;
	private JButton jButtonAddNewItem = null;
	private JButton jButtonSearch = null;
	private JButton jButtonHelp = null;
	private JButton jButtonExit = null;
	private JButton jButtonBack = null;
	private JLabel jLabelItemName = null;
	private JTextField jTextFieldItemName = null;
	private JLabel jLabelCategory = null;
	private JLabel jLabelDescreption = null;
	private JTextField jTextFieldCategory = null;
	private JLabel jLabelAmount = null;
	private JTextField jTextFieldAmount = null;
	private JTextField jTextFieldDescreption = null;
	private JLabel jLabelPrice = null;
	private JTextField jTextFieldPrice = null;
	private JLabel jLabelSpecialSale = null;
	private JTextField jTextFieldSpecialSale = null;
	private JLabel jLabelSearchBy = null;
	private JLabel jLID = null;
	private JLabel jLName = null;
	private JLabel jLCategory = null;
	private JRadioButton jRadioButtonID = null;
	private JRadioButton jRadioButtonName = null;
	private JRadioButton jRadioButtonCategory = null;
	private JTextField jTextFieldSearch = null;
	private JButton jButtonGoSearch = null;
	public EmployeeCatalogOP() {
		super();
		initialize();
	}

	/**
	 * 
	 */
	private void initialize() {
		this.setSize(1000, 720);
		this.setContentPane(MainCatalogOPForm());
		this.setTitle("CATALOG OPTIONS");	
		
		
	}
	private JPanel MainCatalogOPForm() {
		if (mainform == null) {
			jLCategory = new JLabel();
			jLCategory.setBounds(new Rectangle(511, 436, 71, 44));
			jLCategory.setText("CATEGORY");
			jLCategory.setVisible(false);
			jLName = new JLabel();
			jLName.setBounds(new Rectangle(510, 375, 70, 45));
			jLName.setText("NAME");
			jLName.setVisible(false);
			jLID = new JLabel();
			jLID.setBounds(new Rectangle(511, 316, 69, 45));
			jLID.setText("ID");
			jLID.setVisible(false);
			jLabelSearchBy = new JLabel();
			jLabelSearchBy.setBounds(new Rectangle(480, 270, 136, 36));
			jLabelSearchBy.setText("SEARCH BY:");
			jLabelSearchBy.setVisible(false);
			jLabelSpecialSale = new JLabel();
			jLabelSpecialSale.setBounds(new Rectangle(61, 540, 135, 34));
			jLabelSpecialSale.setText("SPECIAL SALE");
			jLabelSpecialSale.setVisible(false);
			jLabelPrice = new JLabel();
			jLabelPrice.setBounds(new Rectangle(61, 495, 135, 34));
			jLabelPrice.setText("PRICE");
			jLabelPrice.setVisible(false);
			jLabelAmount = new JLabel();
			jLabelAmount.setBounds(new Rectangle(61, 446, 135, 34));
			jLabelAmount.setText("AMOUNT");
			jLabelAmount.setVisible(false);
			jLabelDescreption = new JLabel();
			jLabelDescreption.setBounds(new Rectangle(61, 360, 135, 34));
			jLabelDescreption.setText("DESCREPTION");
			jLabelDescreption.setVisible(false);
			jLabelCategory = new JLabel();
			jLabelCategory.setBounds(new Rectangle(61, 315, 135, 34));
			jLabelCategory.setText("Category");
			jLabelCategory.setVisible(false);
			jLabelItemName = new JLabel();
			jLabelItemName.setBounds(new Rectangle(61, 269, 135, 34));
			jLabelItemName.setText("NAME");
			jLabelItemName.setVisible(false);
			jLabelCatalogOptions = new JLabel();
			jLabelCatalogOptions.setBounds(new Rectangle(151, 44, 644, 109));
			jLabelCatalogOptions.setText("CATALOG OPTIONS");			
			mainform = new JPanel();			
			mainform.setLayout(null);
			mainform.setBackground(Color.CYAN); 

			mainform.add(jLabelCatalogOptions, null);
			mainform.add(getJButtonAddNewItem(), null);
			mainform.add(getJButtonSearch(), null);
			mainform.add(getJButtonHelp(), null);
			mainform.add(getJButtonExit(), null);
			mainform.add(getJButtonBack(), null);
			mainform.add(jLabelItemName, null);
			mainform.add(getJTextFieldItemName(), null);
			mainform.add(jLabelCategory, null);
			mainform.add(jLabelDescreption, null);
			mainform.add(getJTextFieldCategory(), null);
			mainform.add(jLabelAmount, null);
			mainform.add(getJTextFieldAmount(), null);
			mainform.add(getJTextFieldDescreption(), null);
			mainform.add(jLabelPrice, null);
			mainform.add(getJTextFieldPrice(), null);
			mainform.add(jLabelSpecialSale, null);
			mainform.add(getJTextFieldSpecialSale(), null);
			mainform.add(jLabelSearchBy, null);
			mainform.add(jLID, null);
			mainform.add(jLName, null);
			mainform.add(jLCategory, null);
			mainform.add(getJRadioButtonID(), null);
			mainform.add(getJRadioButtonName(), null);
			mainform.add(getJRadioButtonCategory(), null);
			mainform.add(getJTextFieldSearch(), null);
			mainform.add(getJButtonGoSearch(), null);
			 


		}
		return mainform; 
	}

	/**
	 * This method initializes jButtonAddNewItem	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonAddNewItem() {
		if (jButtonAddNewItem == null) {
			jButtonAddNewItem = new JButton();
			jButtonAddNewItem.setBounds(new Rectangle(75, 180, 167, 76));
			jButtonAddNewItem.setText("ADD NEW ITEM");		
			jButtonAddNewItem.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					
					jLabelCatalogOptions.setVisible(true);
					jLabelItemName.setVisible(true);
					getJTextFieldItemName().setVisible(true);
					jLabelCategory.setVisible(true);
					jLabelDescreption.setVisible(true);
					getJTextFieldCategory().setVisible(true);
					jLabelAmount.setVisible(true);
					getJTextFieldAmount().setVisible(true);
					getJTextFieldDescreption().setVisible(true);
					jLabelPrice.setVisible(true);
					getJTextFieldPrice().setVisible(true);
					jLabelSpecialSale.setVisible(true);
					getJTextFieldSpecialSale().setVisible(true);
		
				}
			});
		}
		return jButtonAddNewItem;
	}

	/**
	 * This method initializes jButtonSearch	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonSearch() {
		if (jButtonSearch == null) {
			jButtonSearch = new JButton();
			jButtonSearch.setBounds(new Rectangle(572, 178, 167, 76));
			jButtonSearch.setText("SEARCH FOR ITEM");
			jButtonSearch.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					jLabelSearchBy.setVisible(true);
					jLCategory.setVisible(true);
					jLName.setVisible(true);
					jLID.setVisible(true);
					jRadioButtonID.setVisible(true);
					jRadioButtonName.setVisible(true);
					jRadioButtonCategory.setVisible(true);
					
				}
			});
		}
		return jButtonSearch;
	}

	/**
	 * This method initializes jButtonHelp	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonHelp() {
		if (jButtonHelp == null) {
			jButtonHelp = new JButton();
			jButtonHelp.setBounds(new Rectangle(45, 615, 123, 47));
			jButtonHelp.setText("HELP");
		}
		return jButtonHelp;
	}

	/**
	 * This method initializes jButtonExit	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonExit() {
		if (jButtonExit == null) {
			jButtonExit = new JButton();
			jButtonExit.setBounds(new Rectangle(871, 615, 76, 47));
			jButtonExit.setText("EXIT");
			jButtonExit.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					
					ExitFrame EFrame = new ExitFrame();
				    EFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
				    EFrame.setSize( 300,200 ); // set frame size
				    EFrame.setResizable(true);
				    EFrame.setVisible( true ); // display frame
		
				    
				    
				}
			});
		}
		return jButtonExit;
	}

	/**
	 * This method initializes jButtonBack	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonBack() {
		if (jButtonBack == null) {
			jButtonBack = new JButton();
			jButtonBack.setBounds(new Rectangle(778, 615, 90, 47));
			jButtonBack.setText("BACK");
			jButtonBack.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					MainEmployee MFrame = new MainEmployee();
				    MFrame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
				    MFrame.setSize( 1000,720 ); // set frame size
				    MFrame.setResizable(true);
				    MFrame.setVisible( true ); // display frame
				    
				    EmployeeCatalogOP.this.dispose();
				}
			});
		}
		return jButtonBack;
	}

	/**
	 * This method initializes jTextFieldItemName	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldItemName() {
		if (jTextFieldItemName == null) {
			jTextFieldItemName = new JTextField();
			jTextFieldItemName.setBounds(new Rectangle(210, 269, 255, 38));
			jTextFieldItemName.setVisible(false);
		}
		return jTextFieldItemName;
	}

	/**
	 * This method initializes jTextFieldCategory	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldCategory() {
		if (jTextFieldCategory == null) {
			jTextFieldCategory = new JTextField();
			jTextFieldCategory.setBounds(new Rectangle(210, 315, 255, 38));
			jTextFieldCategory.setVisible(false);
		}
		return jTextFieldCategory;
	}

	/**
	 * This method initializes jTextFieldAmount	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldAmount() {
		if (jTextFieldAmount == null) {
			jTextFieldAmount = new JTextField();
			jTextFieldAmount.setBounds(new Rectangle(211, 446, 255, 38));
			jTextFieldAmount.setVisible(false);
		}
		return jTextFieldAmount;
	}

	/**
	 * This method initializes jTextFieldDescreption	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldDescreption() {
		if (jTextFieldDescreption == null) {
			jTextFieldDescreption = new JTextField();
			jTextFieldDescreption.setBounds(new Rectangle(210, 360, 255, 80));
			jTextFieldDescreption.setVisible(false);
		}
		return jTextFieldDescreption;
	}

	/**
	 * This method initializes jTextFieldPrice	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldPrice() {
		if (jTextFieldPrice == null) {
			jTextFieldPrice = new JTextField();
			jTextFieldPrice.setBounds(new Rectangle(210, 495, 255, 38));
			jTextFieldPrice.setVisible(false);
		}
		return jTextFieldPrice;
	}

	/**
	 * This method initializes jTextFieldSpecialSale	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldSpecialSale() {
		if (jTextFieldSpecialSale == null) {
			jTextFieldSpecialSale = new JTextField();
			jTextFieldSpecialSale.setBounds(new Rectangle(210, 541, 255, 80));
			jTextFieldSpecialSale.setVisible(false);
		}
		return jTextFieldSpecialSale;
	}

	/**
	 * This method initializes jRadioButtonID	
	 * 	
	 * @return javax.swing.JRadioButton	
	 */
	private JRadioButton getJRadioButtonID() {
		if (jRadioButtonID == null) {
			jRadioButtonID = new JRadioButton();
			jRadioButtonID.setBounds(new Rectangle(585, 330, 30, 30));
			jRadioButtonID.setVisible(false);
			jRadioButtonID.addItemListener(new java.awt.event.ItemListener() {
				public void itemStateChanged(java.awt.event.ItemEvent e) {
					jTextFieldSearch.setVisible(true);
					jButtonGoSearch.setVisible(true);
				}
			});
		}
		return jRadioButtonID;
	}

	/**
	 * This method initializes jRadioButtonName	
	 * 	
	 * @return javax.swing.JRadioButton	
	 */
	private JRadioButton getJRadioButtonName() {
		if (jRadioButtonName == null) {
			jRadioButtonName = new JRadioButton();
			jRadioButtonName.setBounds(new Rectangle(585, 390, 30, 30));
			jRadioButtonName.setVisible(false);
			jRadioButtonName.addItemListener(new java.awt.event.ItemListener() {
				public void itemStateChanged(java.awt.event.ItemEvent e) {
					jTextFieldSearch.setVisible(true);
					jButtonGoSearch.setVisible(true);
				}
			});
		}
		return jRadioButtonName;
	}

	/**
	 * This method initializes jRadioButtonCategory	
	 * 	
	 * @return javax.swing.JRadioButton	
	 */
	private JRadioButton getJRadioButtonCategory() {
		if (jRadioButtonCategory == null) {
			jRadioButtonCategory = new JRadioButton();
			jRadioButtonCategory.setBounds(new Rectangle(585, 450, 30, 30));
			jRadioButtonCategory.setVisible(false);
			jRadioButtonCategory.addItemListener(new java.awt.event.ItemListener() {
				public void itemStateChanged(java.awt.event.ItemEvent e) {
					jTextFieldSearch.setVisible(true);
					jButtonGoSearch.setVisible(true);
				}
			});
		}
		return jRadioButtonCategory;
	}

	/**
	 * This method initializes jTextFieldSearch	
	 * 	
	 * @return javax.swing.JTextField	
	 */
	private JTextField getJTextFieldSearch() {
		if (jTextFieldSearch == null) {
			jTextFieldSearch = new JTextField();
			jTextFieldSearch.setBounds(new Rectangle(510, 496, 318, 61));
			jTextFieldSearch.setVisible(false);
		}
		return jTextFieldSearch;
	}

	/**
	 * This method initializes jButtonGoSearch	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJButtonGoSearch() {
		if (jButtonGoSearch == null) {
			jButtonGoSearch = new JButton();
			jButtonGoSearch.setBounds(new Rectangle(844, 508, 96, 47));
			jButtonGoSearch.setText("SEARCH");
			jButtonGoSearch.setVisible(false);
		}
		return jButtonGoSearch;
	}
	
	
	
}
